package com.ruoyi.web.controller.ring.app;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.ring.domain.dto.GeneralSecondDTO;
import com.ruoyi.ring.service.IEventInfoSecondService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 活动二级页 （APP）
 */
@Slf4j
@RestController
@RequestMapping("/ring/app/event_info_second")
public class EventInfoSecondController extends BaseController
{
    @Resource
    private IEventInfoSecondService eventInfoSecondService;
    /**
     * 查询日历数据列表-app
     */
    @GetMapping("/query-calendar-list")
    public AjaxResult queryCalendarList(GeneralSecondDTO secondDTO){
        long userId = SecurityUtils.getUserId();
        log.info("查询日历数据列表: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
        return AjaxResult.success(eventInfoSecondService.queryCalendarList(secondDTO));
    }
    /**
     * 二级页 活动
     */
    @GetMapping("/query-event-info")
    public AjaxResult queryEventInfoList(GeneralSecondDTO secondDTO)
    {
        long userId = SecurityUtils.getUserId();
        log.info("活动: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
        return AjaxResult.success(eventInfoSecondService.queryEventInfoList(secondDTO));
    }
    /**
     * 二级页 锻炼记录
     */
    @GetMapping("/query-event-exercise-info")
    public AjaxResult queryEventExerciseInfoList(GeneralSecondDTO secondDTO)
    {
        long userId = SecurityUtils.getUserId();
        log.info("锻炼记录: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
        return AjaxResult.success(eventInfoSecondService.queryEventExerciseInfoList(secondDTO));
    }
    /**
     * 二级页 对比走的距离
     */
    @GetMapping(value = "/query-compare-distance-rate")
    public AjaxResult queryCompareDistanceRate(GeneralSecondDTO secondDTO)
    {
        long userId = SecurityUtils.getUserId();
        log.info("对比走的距离: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
        return AjaxResult.success(eventInfoSecondService.queryCompareDistanceRate(secondDTO));
    }
    /**
     * 二级页 过去七天达成目标情况
     */
    @GetMapping(value = "/query-target-situation")
    public AjaxResult queryTargetSituation(GeneralSecondDTO secondDTO)
    {
        long userId = SecurityUtils.getUserId();
        log.info("过去七天达成目标情况: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
        return AjaxResult.success(eventInfoSecondService.queryTargetSituation(secondDTO));
    }

//    /**
//     * 二级页 体力活动量
//     */
//    @GetMapping(value = "/query-physical-activity-level")
//    public AjaxResult queryPhysicalActivityLevel(GeneralSecondDTO secondDTO)
//    {
//        long userId = SecurityUtils.getUserId();
//        log.info("体力活动量: userId={}, param={}", userId, JSON.toJSONString(secondDTO));
//        return AjaxResult.success(eventInfoSecondService.queryPhysicalActivityLevel(secondDTO));
//    }

}
